<?php

namespace app\common;

use app\common\model\WhiteIpModel;

class NSWhiteIp
{
    public static function check_ip(): bool
    {
        // All clients are allowed to access by default
        if (!$all_ip = WhiteIpModel::lists()) {
            return true;
        }

        return in_array(get_client_ip(), $all_ip);
    }
}
